<head>
    <style>
        ::selection { background-color: red; }
    </style>
    <script type="text/javascript" charset="utf-8">
    function runTest()
    {
        sel.empty();
    }
    </script>
</head>
<body onload="runTest()">
<table><tr><td style="width: 100px; height: 100px;"></td></tr><tr><td style="background-color: green;">&nbsp;<div id="target" style="display: inline-block; height: 100px; width: 10px;"></div></td></tr></table>
<script>
    var sel = getSelection();
    var target = document.getElementById("target");

    sel.setBaseAndExtent(target.previousSibling, 1, target.parentElement.parentElement, 1);
    document.body.offsetTop;
</script>
